﻿using System.Collections.Generic;
using NHibernate;
using NHibernate.Criterion;
using NHibernate.Linq;
using Thaire.Investment.Domains.Transaction;

namespace Thaire.Investment.Repository
{
    public class UnitTrustHeaderRepo : BaseRepository<UnitTrustHeader, int>
    {
        public UnitTrustHeaderRepo(ISession session)
            : base(session)
        {

        }

        //        public IList<UnitTrustHeader> GetListByFundThAndEnName(string fundThName, string fundEnName)
        //        {
        //            //var q = _session.QueryOver<UnitTrustHeader>().Where(x => true);
        //            //if (!string.IsNullOrWhiteSpace(fundThName))
        //            //    q.And(x => x.FundName.StartsWith(fundThName));
        //            //if (!string.IsNullOrWhiteSpace(fundEnName))
        //            //    q.And(x => x.FundNameEn.StartsWith(fundEnName));   
        //            //return q.OrderBy(x => x.CreateDate).Asc.List();
        //var query = _session.GetAllOver()
        //     .Where(Restrictions.On<Entities.SearchTerm>(c => c.Text).IsLike(filter.Value, MatchMode.Start))
        //     .Select(Projections.Distinct(Projections.Property<Entities.SearchTerm>(x => x.Contact)))
        //     .Inner.JoinQueryOver(x => x.Contact).Take(100);
        //    }
    }
}
